local luanwu = fk.CreateSkill {
  name = "lvshi__luanwu",
  tags = {"ready_skill"},
}

Fk:loadTranslationTable{
  ["lvshi__luanwu"] = "乱武",
  [":lvshi__luanwu"] = "<a href='diy_ready_skill'>蓄势技</a>，出牌阶段，你可将一张手牌当<a href=':wenhe_chaos'>【文和乱武】</a>使用并摸一张牌。",
  ["#luanwu-use"] = "请对距离最近的角色视为【杀】，否则你失去1点体力",

  ["$lvshi__luanwu1"] = "哼哼哼，坐山观虎斗！",
  ["$lvshi__luanwu2"] = "哭喊吧，哀求吧，挣扎吧，然后，死吧！",
}

local DIY = require "packages/diy_utility/diy_utility"
luanwu:addEffect("viewas", {
  pattern = "wenhe_chaos",
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and table.contains(player:getCardIds("h"), to_select)
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return nil end
    local card = Fk:cloneCard("wenhe_chaos")
    card.skillName = luanwu.name
    card:addSubcards(cards)
    return card
  end,
  enabled_at_play = function(self, player)
    return not DIY.isReadying(player, luanwu.name)
  end,
  before_use = function(self, player, use)
    player:drawCards(1, luanwu.name)
  end
})


return luanwu